package com.guns.dome1.dao;

import com.guns.dome1.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


public interface IUserDao extends JpaRepository<User, Integer>{



    //根据名字查询
    User findByUsername(String username);
    //查询所有
    //需要单独建立一个ReqVo不能使用ReqUserVo
    @Query(value = "select id,username,real_name,dept_id,role from user",nativeQuery = true)
    List<User> all();
}
